package org.esionwong.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseHelper<T> {
    public String msg;
    public T result;
    public String succ;

    public static  <T>ResponseHelper<T> ok(){
        return new ResponseHelper<>(null, null, "ok");
    }
    public static  <T>ResponseHelper<T> ok(T data){
        return new ResponseHelper<>(null, data, "ok");
    }
    public static  <T>ResponseHelper<T> ok(String msg, T data){
        return new ResponseHelper<>(msg, data, "ok");
    }

    public static <T> ResponseHelper<T> fail(String msg) {
        return new ResponseHelper<>(msg, null, "fail");
    }

}
